<%= form_for [:shop, @spu, @spu_coupon], html: { class: "card" } do |f| %>
  <div class="card-body">
    <h3 class="card-title">
      绑定优惠券
    </h3>
    <div class="row">
      <div class="col-md-6">
        <div class="form-group">
          <label class="form-label">优惠券</label>
          <%= f.select :coupon_id, Coupon.where(shop_id: current_shoper.shop_id).where.not(state: :overdue).select('id, name').map{ |c| [c.name, c.id] }, { include_blank: '请选择优惠券' }, { class: 'form-control select' } %>
        </div>
      </div>
    </div>
  </div>
  <div class="card-footer text-right">
    <%= f.submit "保 存", class: "btn btn-primary" %>
  </div>
<% end %>